package com.xyh.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Component;
import org.springframework.web.context.ContextLoader;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @Author:kyle
 * @Date:2020/12/14 - 15:47
 * @Project:spring_demo1
 * @Package:com.xyh.po
 * @Version:1.0
 */
@Component("user")
@Data
@TableName("t_user")
public class User implements Serializable {
    private static final long serialVersionUID = 9030860424533133179L;
    @TableId(value = "id",type = IdType.AUTO)
    private Integer userId;
    private String userTel;
    private String username;
    private String password;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date registrationTime;

    @TableField(exist = false)
    private List<Role> roles;

    @TableField(value = "fk_user_detail_id")
    private Integer fkUserDetailId;
    @TableField(exist = false)
    private UserDetail userDetail;

    //权限控制
    @TableField(exist = false)
    private List<Permission> permissions;

}
